import { Table } from "antd";
import React from "react";
import axios from "axios";
axios.defaults.timeout = 16000;

class Clj extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      a: [],
      b: [],
      c: [],
      d: [],
      e: [],
      f: [],
      g: [],
      h: [],
      i: [],
      j: [],
      k1: [],
      a12: [],
      a13: [],
      a14: [],
      a15: [],
      a16: [],
      a17: [],
      a1: [],
      a18: [],
      a19: [],
      a20: [],
      a21: [],
      a31: [],
      a22: [],
      a23: [],
      a24: [],
      a25: [],
      a36: [],
      a37: [],
      a38: [],
      a39: [],
      a40: [],
      a26: [],
    };
  }

  /* 
  a= 蔡正平= 43.153.65.89
  b= 郭发展=  43.153.79.98
  c = 郭蒋平= 43.135.172.133
  d  = 郭凯鸿6=43.152.217.89
  e=  郭煜尚7= 43.158.210.229
  f= 李瑶瑶2= 43.158.194.253
  g=  潘秀丽1= 43.134.231.239
  h=    彭香兰8=  43.135.155.149
  i= 叶凤华3=43.156.231.195
  j= 沈信义5=119.28.250.113
  k=刘爱绿4=119.28.250.113
  */
  componentDidMount() {
    // 账号1的高度a
    axios
      .get("http://43.156.127.105:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          a: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ a: "0" });
      });
    //账号2高度b
    axios
      .get("http://43.153.87.183:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          b: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ b: "0" });
      });
    //账号3高度c
    axios
      .get("http://43.153.7.63:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          c: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ c: "0" });
      });
    //账号4高度d
    axios
      .get("http://43.156.100.36:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          d: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ d: "0" });
      });
    //账号5高度e
    axios
      .get("http://129.226.199.247:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          e: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ e: "0" });
      });
    //账号6高度f
    axios
      .get("http://43.153.90.172:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          f: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ f: "0" });
      });
    //账号7高度g
    axios
      .get("http://43.153.107.113:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          g: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ g: "0" });
      });
    //账号8高度h
    axios
      .get("http://43.156.120.243:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          h: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ h: "0" });
      });
    //账号9高度i
    axios
      .get("http://43.153.44.83:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          i: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ i: "0" });
      });
    //账号10高度j
    axios
      .get("http://43.152.215.53:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          j: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ j: "0" });
      });
    //账号11高度k
    axios
      .get("http://43.156.50.51:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          k1: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ k1: "0" });
      });

    //账号12高度a12
    axios
      .get("http://43.153.114.131:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          a12: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ a12: "0" });
      });
    //账号13高度a13
    axios
      .get("http://43.134.166.165:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          a13: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ a13: "0" });
      });
    //账号13高度a14
    axios
      .get("http://43.153.2.20:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          a14: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ a14: "0" });
      });
    //账号13高度a15
    axios
      .get("http://43.153.92.233:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          a15: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ a15: "0" });
      });
    //账号13高度a16
    axios
      .get("http://43.156.250.157:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          a16: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ a16: "0" });
      });
    //账号13高度a17
    axios
      .get("http://43.135.163.194:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          a17: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ a17: "0" });
      });
    //账号13高度a18
    axios
      .get("http://43.153.110.68:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          a18: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ a18: "0" });
      });
    //账号13高度a19
    axios
      .get("http://43.134.165.107:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          a19: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ a19: "0" });
      });
    //账号13高度a20
    axios
      .get("http://43.153.44.106:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          a20: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ a20: "0" });
      });
    //账号13高度a21
    axios
      .get("http://43.156.120.243:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          a21: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ a21: "0" });
      });
    //账号13高度a22
    axios
      .get("http://43.153.35.169:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          a22: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ a22: "0" });
      });
    //账号13高度a23
    axios
      .get("http://43.135.166.37:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          a23: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ a23: "0" });
      });
     //账号13高度a24
     axios
     .get("http://43.156.83.81:31401")
     .then((res) => {
       console.log(res.data.core_latest_ledger);
       this.setState({
         a24: res.data.core_latest_ledger,
       });
     })
     .catch((err) => {
       this.setState({ a24: "0" });
     });
      //账号13高度a25
      axios
      .get("http://43.134.239.233:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          a25: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ a25: "0" });
      });
    
  }
  render() {
    const dataSource = [
      {
        key: "1",
        name: "白永珠",
        address: this.state.a,
        differ: this.state.a - this.state.a,
        todesk: "822 856 803",
        ip: (
          <a href="http://43.156.127.105:31401" target="_blank">
            43.156.127.105
          </a>
        ),
        des: "云服务器美国",
      },
      {
        key: "2",
        name: "程良军",
        address: this.state.b,
        differ: this.state.a - this.state.b,
        todesk: "727 521 647",
        ip: (
          <a href="http://43.153.87.183:31401" target="_blank">
            43.153.87.183
          </a>
        ),
        des: "云服务器美国",
      },
      {
        key: "3",
        name: "程丽英",
        address: this.state.c,
        differ: this.state.a - this.state.c,
        todesk: "164 936 827",
        ip: (
          <a href="http://43.153.7.63:31401" target="_blank">
            43.153.7.63
          </a>
        ),
        des: "云服务器美国",
      },
      {
        key: "4",
        name: "程少英",
        address: this.state.d,
        differ: this.state.a - this.state.d,
        todesk: "735 628 019",
        ip: (
          <a href="http://43.156.100.36:31401" target="_blank">
           43.156.100.36
          </a>
        ),
        des: "云服务器新加坡",
      },
      {
        key: "5",
        name: "程圣宇",
        address: this.state.e,
        differ: this.state.a - this.state.e,
        todesk: "466 137 197",
        ip: (
          <a href="http://129.226.199.247:31401" target="_blank">
            129.226.199.247
          </a>
        ),
        des: "云服务器新加坡",
      },
      {
        key: "6",
        name: "程小莲",
        address: this.state.f,
        differ: this.state.a - this.state.f,
        todesk: "828 529 158",
        ip: (
          <a href="http://43.153.90.172:31401" target="_blank">
            43.153.90.172
          </a>
        ),
        des: "云服务器美国",
      },
      {
        key: "7",
        name: "黄光富",
        address: this.state.g,
        differ: this.state.a - this.state.g,
        todesk: "538 280 285",
        ip: (
          <a href="http://43.153.107.113:31401" target="_blank">
            43.153.107.113
          </a>
        ),
        des: "云服务器美国",
      },
      {
        key: "8",
        name: "黄康年",
        address: this.state.h,
        differ: this.state.a - this.state.h,
        todesk: "496 909 160",
        ip: (
          <a href="http://43.156.120.243:31401" target="_blank">
           43.156.120.243
          </a>
        ),
        des: "云服务器新加坡",
      },
      {
        key: "9",
        name: "黄利娅",
        address: this.state.i,
        differ: this.state.a - this.state.i,
        todesk: "198 218 470",
        ip: (
          <a href="http://43.153.44.83:31401" target="_blank">
            43.153.44.83
          </a>
        ),
        des: "云服务器美国",
      },
      {
        key: "10",
        name: "林恒",
        address: this.state.j,
        differ: this.state.a - this.state.j,
        todesk: "807 427 927.",
        ip: (
          <a href="http://43.152.215.53:31401" target="_blank">
            43.152.215.53
          </a>
        ),
        des: <font color = 'red'>云服务器孟买</font>,
      },
      {
        key: "11",
        name: "林开奖",
        address: this.state.k1,
        differ: this.state.a - this.state.k1,
        todesk: "461 468 223",
        ip: (
          <a href="http://43.156.50.51:31401" target="_blank">
            43.156.50.51
          </a>
        ),
        des: "云服务器新加坡",
      },
      {
        key: "12",
        name: "林巧玲",
        address: this.state.a12,
        differ: this.state.a - this.state.a12,
        todesk: "457 395 378",
        ip: (
          <a href="http://43.153.114.131:31401" target="_blank">
            43.153.114.131
          </a>
        ),
        des: "云服务器美国",
      },
      {
        key: "13",
        name: "梅晓春",
        address: this.state.a13,
        differ: this.state.a - this.state.a13,
        todesk: "888 936 357",
        ip: (
          <a href="http://43.134.166.165:31401" target="_blank">
           43.134.166.165
          </a>
        ),
        des: "云服务器新加坡",
      },
      {
        key: "14",
        name: "潘志琴",
        address: this.state.a14,
        differ: this.state.a - this.state.a14,
        todesk: "478 063 706",
        ip: (
          <a href="http://43.153.2.20:31401" target="_blank">
            43.153.2.20
          </a>
        ),
        des: "云服务器美国",
      },
      {
        key: "15",
        name: "吴信宏",
        address: this.state.a15,
        differ: this.state.a - this.state.a15,
        todesk: "218 542 947",
        ip: (
          <a href="http://43.153.92.233:31401" target="_blank">
            43.153.92.233
          </a>
        ),
        des: "云服务器美国",
      },
      {
        key: "16",
        name: "王吴跃刚",
        address: this.state.a16,
        differ: this.state.a - this.state.a16,
        todesk: "873 225 594",
        ip: (
          <a href="http://43.156.250.157:31401" target="_blank">
           43.156.250.157
          </a>
        ),
        des: "云服务器美国",
      },
      {
        key: "17",
        name: "谢卿初",
        address: this.state.a17,
        differ: this.state.a - this.state.a17,
        todesk: "531 981 424",
        ip: (
          <a href="http://43.135.163.194:31401" target="_blank">
            43.135.163.194
          </a>
        ),
        des: "云服务器美国",
      },
      {
        key: "18",
        name: "谢雨辰",
        address: this.state.a18,
        differ: this.state.a - this.state.a18,
        todesk: "249 365 983",
        ip: (
          <a href="http://43.153.110.68:31401" target="_blank">
            43.153.110.68
          </a>
        ),
        des: "云服务器美国",
      },
      {
        key: "19",
        name: "薛秀玲",
        address: this.state.a19,
        differ: this.state.a - this.state.a19,
        todesk: "384 733 223",
        ip: (
          <a href="http://43.134.165.107:31401" target="_blank">
            43.134.165.107
          </a>
        ),
        des: "云服务器美国",
      },
      {
        key: "20",
        name: "徐小蓉",
        address: this.state.a20,
        differ: this.state.a - this.state.a20,
        todesk: "343 624 823",
        ip: (
          <a href="http://43.153.44.106:31401" target="_blank">
            43.153.44.106
          </a>
        ),
        des:<font color='red'>云服务器孟买</font> ,
      },
      {
        key: "21",
        name: "曾王李",
        address: this.state.a21,
        differ: this.state.a - this.state.a21,
        todesk: "250 345 912",
        ip: (
          <a href="http://43.156.120.243:31401" target="_blank">
            43.156.120.243
          </a>
        ),
        des: "云服务器新家坡",
      },
      {
        key: "22",
        name: "张晓燕",
        address: this.state.a22,
        differ: this.state.a - this.state.a22,
        todesk: "499 068 163",
        ip: (
          <a href="http://43.153.35.169:31401" target="_blank">
            43.153.35.169
          </a>
        ),
        des: "云服务器美国",
      },
      {
        key: "23",
        name: "赵前进",
        address: this.state.a23,
        differ: this.state.a - this.state.a23,
        todesk: "984 869 198",
        ip: (
          <a href="http://43.135.166.37:31401" target="_blank">
            43.135.166.37
          </a>
        ),
        des: "云服务器美国",
      },
      {
        key: "24",
        name: "郑良成",
        address: this.state.a24,
        differ: this.state.a - this.state.a24,
        todesk: "456 826 459",
        ip: (
          <a href="http://43.156.83.81:31401" target="_blank">
            43.156.83.81
          </a>
        ),
        des: "云服务器新加坡",
      },
      {
        key: "25",
        name: "朱守放",
        address: this.state.a25,
        differ: this.state.a - this.state.a25,
        todesk: "752 251 026",
        ip: (
          <a href="http://43.134.239.233:31401" target="_blank">
           43.134.239.233
          </a>
        ),
        des: "云服务器新加坡",
      },
      
     
      
     
    ];

    const columns = [
      {
        title: "业主名字",
        dataIndex: "name",
        key: "name",
      },
      {
        title: "区块高度",
        dataIndex: "address",
        key: "address",
      },
      {
        title: "区块延迟数值",
        dataIndex: "differ",
        key: "differ",
      },
      {
        title: "todesk",
        dataIndex: "todesk",
        key: "todesk",
      },
      {
        title: "云服务器ip地址",
        dataIndex: "ip",
        key: "ip",
      },
      {
        title: "云服务器地区",
        dataIndex: "des",
        key: "des",
      },
    ];
    return (
      <div>
        <center>
          <font size="18" color="red">
            程良军25台节点区块高度
          </font>
          <Table dataSource={dataSource} columns={columns} />;
        </center>
      </div>
    );
  }
}

export default Clj;
